package com.lhkj.ct.meta.modules.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.lhkj.ct.base.constants.DictConstants;
import com.lhkj.ct.base.utils.LambdaUtils;
import com.lhkj.ct.meta.modules.patient.model.entity.TblPatient;
import com.lhkj.ct.meta.modules.psychology.model.bo.PatientItem;

/**
 * <p>
 * 档案模板
 * </p>
 */
public enum PatientModule implements IEnum<Integer> {

    PAT_NAME(1, "姓名",
            new PatientItem("姓名", LambdaUtils.getName(TblPatient::getPatName), "text", null, null, true, null)),
    PAT_SEX(2, "性别",
            new PatientItem("性别", LambdaUtils.getName(TblPatient::getPatSex), "select", null, DictConstants.GENDER, true, null)),
    PAT_BIRTHDAY(3, "出生日期",
            new PatientItem("出生日期", LambdaUtils.getName(TblPatient::getPatBirthday), "date", "yyyy-MM-dd", null, true, null)),
    PAT_IDENT_TYPE(4, "证件类型",
            new PatientItem("证件类型", LambdaUtils.getName(TblPatient::getPatIdentType), "select", null, DictConstants.IDENT_TYPE, true, null)),
    PAT_IDENT_NO(5, "证件号码",
            new PatientItem("证件号码", LambdaUtils.getName(TblPatient::getPatIdentNo), "text", null, null, true, null)),
    PAT_MOBILE(6, "手机号码",
            new PatientItem("手机号码", LambdaUtils.getName(TblPatient::getPatMobile), "text", null, null, false, null)),
    PAT_NATION(7, "民族",
            new PatientItem("民族", LambdaUtils.getName(TblPatient::getPatNation), "select", null, DictConstants.NATION, false, null)),
    PAT_EDUCATION(8, "学历",
            new PatientItem("学历", LambdaUtils.getName(TblPatient::getPatEducation), "select", null, DictConstants.EDUCATION, false, null)),
    PAT_MARRIAGE(9, "婚姻状况",
            new PatientItem("婚姻状况", LambdaUtils.getName(TblPatient::getPatMarriage), "select", null, DictConstants.MARRIAGE, false, null));

    @EnumValue
    private final int code;

    private final String desc;

    private final PatientItem item;

    PatientModule(int code, String desc, PatientItem item) {
        this.code = code;
        this.desc = desc;
        this.item = item;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public PatientItem getItem() {
        return item;
    }

    @Override
    public Integer getValue() {
        return getCode();
    }
}
